package com.mdd.maduoduo.data.network;

import com.mdd.maduoduo.entity.BannerEntity;
import com.mdd.maduoduo.entity.CheckVersionEntity;
import com.mdd.maduoduo.entity.LoginEntity;
import com.mdd.maduoduo.entity.MaxConfigEntity;
import com.mdd.maduoduo.entity.MaxDataEntity;
import com.mdd.maduoduo.entity.QueryListEntity;
import com.mdd.maduoduo.entity.Response;
import com.mdd.maduoduo.entity.ShareCodeEntity;
import com.mdd.maduoduo.entity.StationEntity;
import com.mdd.maduoduo.entity.UserEntity;

import java.util.HashMap;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

public interface LoginService {

    /**
     * 发起微信登录
     */
    @POST
    @Headers({"Authorization: Basic bWdnLWFwcC13ZWNoYXQ6dHJVZkBFSHdtN0g4alR3UjN6NTg5RURjQUx6ZDV0eHg=","content-Type: application/x-www-form-urlencoded"})
    Observable<Response<LoginEntity>> login(@Url String url);

    /**
     * 获取用户信息
     */
    @GET("olda-shunshun-expressage-service/user/getMddUserInfo")
    Observable<UserEntity> getUser(@Header("Authorization")String token);

    /**
     * 93000、查询功能配置列表接口
     */
    @GET("olda-shunshun-expressage-service/mddMaxConfig/selectFunctionsConfig")
    Observable<MaxConfigEntity> getMaxConfig(@Header("Authorization")String token);

    /**
     * 93001、切换功能开关接口
     */
    @POST("olda-shunshun-expressage-service/mddMaxConfig/switchFunction")
    Observable<Response> setSwitch(@Header("Authorization")String token,@Body HashMap<String, Object> map);

    /**
     * 93000、查询功能配置列表接口
     */
    @GET("olda-shunshun-expressage-service/mdd/selectMaxPageData")
    Observable<MaxDataEntity> getMaxData(@Header("Authorization")String token);

    /**
     * 91012、码管管权益兑换接口
     */
    @POST("olda-shunshun-expressage-service/mddExpressPickupInfo/equityExchange")
    Observable<Response> exchange(@Header("Authorization")String token,@Body HashMap<String, Object> map);

    /**
     * 91008、码管管登出接口
     */
    @GET("olda-shunshun-expressage-service/user/logOut")
    Observable<Response> logout(@Header("Authorization")String token);

    /**
     * 92002、码管管新增共享码接口
     */
    @POST("olda-shunshun-expressage-service/mdd/addSharedCode")
    Observable<Response> addShareCode(@Header("Authorization")String token,@Body HashMap<String, Object> map);

    /**
     * 92001、码管管共享码记录查询接口
     */
    @GET("olda-shunshun-expressage-service/mdd/selectSharedCodeData")
    Observable<ShareCodeEntity> getShareCode(@Header("Authorization")String token);

    /**
     * 92003、码管管删除共享码接口
     */
    @GET("olda-shunshun-expressage-service/mdd/deleteSharedCode")
    Observable<Response> deleteShareCode(@Header("Authorization")String token, @Query("pickupSharedCode")String pickupSharedCode);

    /**
     * 93002、更新待取件定时提醒时间接口
     */
    @POST("olda-shunshun-expressage-service/mddMaxConfig/updateScheduleTime")
    Observable<Response> updateTime(@Header("Authorization")String token,@Body HashMap<String, Object> map);

    /**
     * 91004、手动录入取件码接口
     */
    @POST("olda-shunshun-expressage-service/mddExpressPickupInfo/manualInput")
    Observable<Response> addMsg(@Header("Authorization")String token,@Body HashMap<String, Object> map);

    /**
     * 91001、分页查询待取件列表数据
     */
    @POST("olda-shunshun-expressage-service/mddExpressPickupInfo/pagedQuery")
    Observable<QueryListEntity> queryList(@Header("Authorization")String token, @Body HashMap<String, Object> map);

    /**
     * 92001、码管管共享码记录查询接口
     */
    @GET("olda-shunshun-expressage-service/mddExpressPickupInfo/stationStatistics")
    Observable<StationEntity> getStation(@Header("Authorization")String token,@Query("pickupStatus")int pickupStatus);

    /**
     * 91010、更新取件码状态信息接口
     */
    @POST("olda-shunshun-expressage-service/mddExpressPickupInfo/updatePickupCodeStatus")
    Observable<Response> updateCodeStatus(@Header("Authorization")String token, @Body HashMap<String, Object> map);

    /**
     * 91010、更新取件码状态信息接口
     */
    @POST("olda-shunshun-expressage-service/mddExpressPickupInfo/delete")
    Observable<Response> deleteCode(@Header("Authorization")String token, @Body HashMap<String, Object> map);

    /**
     * 92005、根据页面查询轮播图数据接口
     */
    @GET("olda-shunshun-expressage-service/mdd/selectMddFunctionConfigList")
    Observable<BannerEntity> getBannerList(@Header("Authorization")String token, @Query("pTag")String pTag);


    /**
     * 91011、版本检查接口
     */
    @POST("olda-shunshun-expressage-service/green/mdd/checkVersion")
    Observable<CheckVersionEntity> checkVersion(@Header("Authorization")String token, @Body HashMap<String, Object> map);

}
